<?php
/**
 * @var \Ke\Web\Web     $web
 * @var \Ke\Web\Http    $http
 * @var \Ke\Web\Html    $html
 * @var \Ke\Web\Context $this
 */

$trace = $trace ?? [];
$i = count($trace);

if (empty($trace))
	return '';

$options = [
	'columns' => [
		'file'     => 'File',
		'line'     => 'Line',
		'function' => 'Function',
	],
	'onRow'   => function (\Ke\Web\Html $html, $data, $clone) {
		if (!empty($data['class']) && !empty($data['type']) && !empty($data['function'])) {
			$clone['function'] = sprintf('%s%s%s()', $data['class'], $data['type'], $data['function']);
			$clone['function'] = $html->tag('code', $clone['function']);
		}
	},
	'attr'    => [
		'class' => 'red',
	],
];

$table = $html->tableList($trace, $options);
?>
	<address><?php print $file . '#' . $line; ?></address>
<?php print $table; ?>